<?php if($this->error==2) {?>
<center><?php echo $this->textError10;?></center>
<?php }else{?>
<link rel="stylesheet" type="text/css" href="/css/support.css" />
<fieldset id="table">

							<div id="contentSupportInfor">
								<span class="SupportInformation"><b><?php echo $this->textInfoUser;?></b></span>
								<table width="100%">
									<tbody><tr>
										<td class="infor">
											<p class="infortxt"><?php echo $this->textName;?>:</p>
										</td>
										<td class="txtInput">
											<input type="text" class="input" maxlength="20" size="20" id="txtName" name="txtName" value="<?php echo $this->name;?>">
										</td>
									</tr>
									<tr>
										<td class="infor">
											<p class="infortxt"><?php echo $this->textPos;?>:</p>
										</td>
										<td class="txtInput" style="padding-top:10px; padding-bottom:10px;">
										<div style="width:263px; height:26px; margin-top:5px; margin-bottom:5px;">
											<div style="width:30%; height:26px; float:left;"><?php echo $this->text_default;?> </div>
											<div style="width:70%; height:26px; float:right;"><input type = "text"  name="pos[default]" id="pos[default]" size="25" maxlength="45"  value="<?php echo $this->pos['Default'];?>"></input></div>
										</div>
										<?php if(isset($this->languages) && count($this->languages) > 0 ){?>
										<?php foreach ($this->languages as $lang){?>
											<div style="width:263px; height:26px; margin-top:5px; margin-bottom:5px;">
												<div  style="width:30%; height:26px; float:left;"><?php if( $lang['name']=='English') echo $this->text_English;
												
															else {
																if($lang['name']=='Vietnamese')
																	echo $this->text_Vietnamese	;
															}
												
												?> </div>
												<div class="txtInput" style="width:70%; height:26px; float:right;"><input type = "text"  name="pos[<?php echo $lang['name'];?>]" id="pos[<?php echo $lang['name'];?>]" size="25" maxlength="45"  value="<?php echo $this->pos[$lang['name']];?>"></input></div>		
											</div>
										<?php }?>
									<?php }?>	
										</td>
									</tr>
									<tr>
										<td class="infor">
											<p class="infortxt"><?php echo $this->textYahoo;?>:</p>                                      
										</td>
										<td class="txtInput">
											<input type="text" class="input" maxlength="20" size="20" id="txtYahoo" name="txtYahoo" value="<?php echo $this->yahoo;?>">
										</td>
									</tr>
									<tr>
										<td class="infor">
											<p class="infortxt"><?php echo $this->textSkype;?>:</p>                                      
										</td>
										<td class="txtInput">
											<input type="text" class="input" maxlength="20" size="20" id="txtSkype" name="txtSkype" value="<?php echo $this->skype;?>">
										</td>
									</tr>
									<tr>
										<td class="infor">
											<p class="infortxt"><?php echo $this->textPhone;?>:</p>                                      
										</td>
										<td class="txtInput">
											<input type="text" class="input" maxlength="20" size="20" id="txtPhone" name="txtPhone"value="<?php echo $this->phone;?>">
										</td>
									</tr>
							<tr>
							<td colspan="2" style="    height: 35px;"> 
							<div id="contentAdd">  
								<input type="button" onclick="EditModule();"name="EditSupport" id="EditSupport" style="margin-left:400px; margin-top:10px" class="btnSupport" value="<?php echo $this->textSave;?>"  >
							
							</div>
							</td>
							</tr>
								</tbody></table>
							</div> 
							<input type="hidden" name="id" id="id" value="<?php  echo $this->id;?> ">
						</fieldset>
<script type="text/javascript">
function EditModule()
{
	
	var _posDefault= document.getElementById("pos[default]").value;
	var _pos = '';
		<?php if(isset($this->languages) && count($this->languages) > 0 ){?>
		<?php foreach ($this->languages as $lang){?>
		<?php echo ('_pos += "&pos'.$lang['name'].'=" + document.getElementById("pos['.$lang['name'].']").value;');?>
		<?php }?>
		<?php }?>	
	
	var _name= document.getElementById("txtName").value ;
	var _yahoo= document.getElementById("txtYahoo").value ;
	var _skype= document.getElementById("txtSkype").value ;
	var _phone= document.getElementById("txtPhone").value ;
	var _id= document.getElementById("id").value ;
	
	if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange = function()
	{	
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			if(xmlhttp.responseText == "-1")
			{
				alert(<?php echo "'".$this->textError1."'";?>);
				//alert(xmlhttp.responseText);
			}
			else if(xmlhttp.responseText == "-2" )
			{
				alert(<?php echo "'".$this->textError2."'";?>);
			}
			else if(xmlhttp.responseText == "-3")
			{
				alert(<?php echo "'".$this->textError3."'";?>);
			}
			else if(xmlhttp.responseText == "-4")
			{
				alert(<?php echo "'".$this->textError4."'";?>);
			}
			
			else
			{	
				window.parent.$.prettyPhoto.close();
				window.top.location.reload();
			}
		}	
	};
	var pos=_posDefault+_pos;
	var url = "/supportonline/clickchange/editsupport?name="+_name+"&posDefault="+pos+"&yahoo="+_yahoo+"&skype="+_skype+"&phone="+_phone+"&id="+_id;
	xmlhttp.open("GET",url,true);	
	xmlhttp.send();
	return false;
}
</script>
<?php }?>
						